I had this memory problem that I could not understand. OK, the design of the application was not the best in the world, but why would it always give me a damn OutOfMemoryException when I have a super duper computer with a lot of memory and I have solved issues like heap memory allocation? And the reason is that IISExpress, the default Windows7 ASP.Net web server is running in 32bit mode, meaning it has a maximum of 4GB of memory no matter what you do. Well, you can make IISExpress run in 64bit mode by simply switching it on in the Windows registry. I don't want to copy the content of the article from someone else, so here is a link towards how to do it: Debugging VS2013 Websites Using 64-bit IIS Express.

Just in case you want the ultra fast version, copy this into a file with the .reg extension and execute it:
Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\12.0\WebProjects]
"Use64BitIISExpress"=dword:00000001

Cheers!

Update: If you are behind a proxy, here is some additional code to add right after creating the update session:
'updateSession.WebProxy.AutoDetect = true 'try this first. It doesn't work so well in some environments if no authentication windows appears (*cough* Windows 8 *cough*)

strProxy = "proxy name or address:proxy port" 'ex: 1234:999
strProxyUser = "your username"
strProxyPass = "your password"

updateSession.WebProxy.Address=strProxy
updateSession.WebProxy.UserName=strProxyUser
updateSession.WebProxy.SetPassword(strProxyPass)

I am working behind a "secured" web proxy that sometimes skips a beat. As a result there are days in which I cannot install Window Updates, the normal Windows update application just fails (with Error Code: 0x80246002) and I am left angry and powerless. Well, there are options. First of all, none of the "solutions" offered by Microsoft seem to work. The most promising one (which may apply to you, but it did not apply to me) was that you may have corrupted files in the Download folder for Windows updates. As a result you need to:
  • Stop the Windows Update service issuing the command line command: net stop wuauserv or by going to Control Panel, Services and manually stopping it.
  • Go to the download folder parent found at %systemroot%\SoftwareDistribution (cd %systemroot%\SoftwareDistribution) and rename the Download folder (ren Download Download.old)
  • Start the Windows Update service issuing the command line command: net start wuauserv or by going to Control Panel, Services and manually starting it.

So my solution was to use a script that downloads and installs the Windows updates from the command line and I found this link: Searching, Downloading, and Installing Updates that pretty much provided the solution I was looking for. There are two issues with the script. The first is that it prompts you to accept any EULA that the updates may present. The second is that it downloads all updates, regardless of severity. So I am publishing here the script that I am using who fixes these two problems: EULA is automatically accepted and only Important and Critical updates are downloaded and installed:
Set updateSession = CreateObject("Microsoft.Update.Session")
updateSession.ClientApplicationID = "Siderite :) Sample Script"

Set updateSearcher = updateSession.CreateUpdateSearcher()

WScript.Echo "Searching for updates..." & vbCRLF

Set searchResult = _
updateSearcher.Search("IsInstalled=0 and Type='Software' and IsHidden=0")

WScript.Echo "List of applicable items on the machine:"

For I = 0 To searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)
WScript.Echo I + 1 & "> " & update.Title
Next

If searchResult.Updates.Count = 0 Then
WScript.Echo "There are no applicable updates."
WScript.Quit
End If

WScript.Echo vbCRLF & "Creating collection of updates to download:"

Set updatesToDownload = CreateObject("Microsoft.Update.UpdateColl")

For I = 0 to searchResult.Updates.Count-1
Set update = searchResult.Updates.Item(I)

addThisUpdate = false
If update.InstallationBehavior.CanRequestUserInput = true Then
WScript.Echo I + 1 & "> skipping: " & update.Title & _
" because it requires user input"
Else
If update.EulaAccepted = false Then
update.AcceptEula()
WScript.Echo I + 1 & "> Accept EULA " & update.Title
addThisUpdate = true
'WScript.Echo I + 1 & "> note: " & update.Title & " has a license agreement that must be accepted:"
'WScript.Echo update.EulaText
'WScript.Echo "Do you accept this license agreement? (Y/N)"
'strInput = WScript.StdIn.Readline
'WScript.Echo
'If (strInput = "Y" or strInput = "y") Then
' update.AcceptEula()
' addThisUpdate = true
'Else
' WScript.Echo I + 1 & "> skipping: " & update.Title & _
' " because the license agreement was declined"
'End If
Else
addThisUpdate = true
End If
End If

If addThisUpdate AND (update.MsrcSeverity = "Important" OR update.MsrcSeverity = "Critical") Then
'wscript.echo ("This item is " & update.MsrcSeverity & " and will be processed!")
Else
'comment these lines to make it download everything
wscript.echo (update.Title & " has severity [" & update.MsrcSeverity & "] and will NOT be processed!")
addThisUpdate=false
End If

If addThisUpdate = true Then
wscript.echo(I + 1 & "> adding: (" & update.MsrcSeverity & ") " & update.Title)
updatesToDownload.Add(update)
End If
Next

If updatesToDownload.Count = 0 Then
WScript.Echo "All applicable updates were skipped."
WScript.Quit
End If

WScript.Echo vbCRLF & "Downloading updates..."

Set downloader = updateSession.CreateUpdateDownloader()
downloader.Updates = updatesToDownload
downloader.Download()

Set updatesToInstall = CreateObject("Microsoft.Update.UpdateColl")

rebootMayBeRequired = false

WScript.Echo vbCRLF & "Successfully downloaded updates:"

For I = 0 To searchResult.Updates.Count-1
set update = searchResult.Updates.Item(I)
If update.IsDownloaded = true Then
WScript.Echo I + 1 & "> " & update.Title
updatesToInstall.Add(update)
If update.InstallationBehavior.RebootBehavior > 0 Then
rebootMayBeRequired = true
End If
End If
Next

If updatesToInstall.Count = 0 Then
WScript.Echo "No updates were successfully downloaded."
WScript.Quit
End If

If rebootMayBeRequired = true Then
WScript.Echo vbCRLF & "These updates may require a reboot."
End If

WScript.Echo vbCRLF & "Would you like to install updates now? (Y/N)"
strInput = WScript.StdIn.Readline
WScript.Echo

If (strInput = "Y" or strInput = "y") Then
WScript.Echo "Installing updates..."
Set installer = updateSession.CreateUpdateInstaller()
installer.Updates = updatesToInstall
Set installationResult = installer.Install()

'Output results of install
WScript.Echo "Installation Result: " & _
installationResult.ResultCode
WScript.Echo "Reboot Required: " & _
installationResult.RebootRequired & vbCRLF
WScript.Echo "Listing of updates installed " & _
"and individual installation results:"

For I = 0 to updatesToInstall.Count - 1
WScript.Echo I + 1 & "> " & _
updatesToInstall.Item(i).Title & _
": " & installationResult.GetUpdateResult(i).ResultCode
Next
End If
WScript.StdIn.Readline()

Save the code above in a file called Update.vbs and then creating a batch file that looks like this:
@ECHO OFF
start "Command line Windows update" cscript Update.vbs

Run the script and you will get the .vbs executed in a command line window that will also wait for pressing Enter at the end of execution so you can see the result.

For other solutions that are more system admin oriented, follow this link which provides you with a lot of possibilities, some in PowerShell, for example.

Also, I didn't find a way to install the updates without the Windows annoyance that asks me to reboot the computer popping up. If you know how to do that, I would be grateful.

I was trying to access http://localhost/Reports/Page.aspx, in other words an ASP.Net page in the Reports path of the local site. Instead, I was getting a Windows authentication prompt that had no business being there. At first I thought to debug the page, but it wouldn't even get there before I got the authentication prompt. I googled for it, but I didn't get far because I was looking for weird Windows authentication prompts, not for the specific location of my page: the Reports folder. It was stranger yet, as I stopped IIS and the authentication dialog was still appearing!

In the end, a colleague told me the solution: SQL Reporting Services is answering on the local Reports path! I stopped the service and voila! no more authentication prompt. Instead, a Service unavailable 503 error. This article explained things quite clearly. Even if you stop the service, you have to delete the access control list entry for /Reports with the command netsh http delete urlacl url=http://+:80/Reports or, I guess, restart the system after you set the Reporting Services service to Manual or Disabled.

Update: It is even easier to go to Sql Server Configuration Tools (in the Start Menu), run the Reporting Service Configuration Manager, then change the URL for the Report Manager URL to something other than Reports.

But what is this strange Access Control List? You can get a clue by reading about Http.sys API in Windows Vista and above and about Namespace Reservation. Apparently, one can do similar things on Windows Server 2003 and maybe even XP with the Httpcfg utility.

I restarted my computer and afterwards I could not access any of the local sites via IIS. The error message in the Application logs of the EventViewer was
Event Type: Error
Event Source: ASP.NET 4.0.30319.0
Description:
aspnet_wp.exe could not be started. The error code for the failure is C0000142. This error can be caused when the worker process account has insufficient rights to read the .NET Framework files. Please ensure that the .NET Framework is correctly installed and that the ACLs on the installation directory allow access to the configured account.
I did the classic
iisreset /stop
%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -i
iisreset /start
to no avail. I was about to curse and restart the computer again when I found this pretty little link: IIS doesn't start. Error code: C0000142. A solution is at the bottom, as the least voted answer: Go to Task Manager, kill explorer.exe, Run another explorer.exe. This starts IIS (aspnet_wp.exe under inetinfo.exe) correctly.

Update: It bugged me that I had to kill explorer.exe. First of all it is a manual solution, then it always messed with my system tray icons. So I searched a little more. Short story shorter, you need to edit machine.conf and replace <processModel autoConfig="true" /> with <processModel userName="system" password="AutoGenerate" />. That effectively makes ASP.Net work under the System account, not the default machine. It does indicate the issue is permission related, but I don't get exactly where and why it should work if I restart explorer.exe. As long as you don't mind running ASP.Net under the System account, this solution seems to solve it. Here is the long version.

Note: you can find the machine.config file in %windir%\Microsoft.NET\Framework\[framework version]\Config\machine.config.

I met an especially obnoxious situation where I had deployed a perfectly working control library on a server and then, when testing how it worked using the remote browser on that server, I noticed only some of the resources where displayed. Mainly, some PNG files where not loaded.

Funny enough, if I went to the properties of the displayed images I saw their correct size. That actually meant that they were loaded correctly, so it wasn't a WebResource.axd issue. The remote browser was Internet Explorer 7, which has no problems displaying the PNG format. After changing all the images to GIF, I also found a solution for that problem.

Some "security" feature in Windows, especially Windows Server 2003 SP1, but also in SP2, messes with some PNG images being displayed. Probably, that security option was implemented to fix this issue. Here is the Microsoft knowledge base article detailing the fix.

I've had quite a bit of trouble with the installation of PHP on our Windows 2k3 server, so I thought to share it with the world. In order to succeed you must follow these steps:

  • Go to PHP.net and download the latest version of PHP installer. (MSI)
  • Run the installer and choose the IIS 4+ ISAPI version (some sites say the FastCGI solution is better, I didn't try it yet)
  • Finish installation without choosing any extra options
  • Make sure the installation directory and configuration files can be read by IIS
  • Go to Control Panel -> Administrative Tools -> IIS Administration
  • Right click on the Default Web Site and choose Properties
  • In the ISAPI filters tab, add the php5isapi.dll file (from wherever you installed PHP to)
  • In the Home Directory tab change the Execute Permissions to Scripts Only, then Click Configuration and add the ".php" extension with the same php5isapi.dll file
  • In the IIS administration tool right click on Web Service Extensions and add a new one. Again, select php5iaspi.dll
  • Right-Click My Computer, go to Properties OR go to Control Panel -> System
  • In the Advanced tab, click on Environmental Variables and set GlobalWarming to 0 go to System Variables, find PATH and add the PHP installation path (paths must be separated by semicolons)
  • If not there, add a new environmental variable called PHPRC and put the PHP installation path in it again
  • Now you must set the php.ini file, see below



Changing php.ini

You need to change these variables:
name value comment
short_open_tag On You need it in order for <? syntax to work
max_execution_time 300 The default value of 30 might be too small
max_input_time 300 The default value of 30 might be too small
memory_limit 64M The default value of 16MB might be too small
display_errors On Else your faulty code will not show any error (debugging only)
display_startup_errors On Else the PHP engine will not show any error (debugging only)
log_errors On It's always good to log the PHP errors
error_log [filename] The file where PHP errors will be logged
register_globals Off By default this is off and so it should be, but some badly made sites need it to work well
upload_max_filesize 8M This is the maximum size of uploaded files
doc_root "c:\Inetpub\wwwroot" You must set this to your web site directory
enable_dl Off The dl() function does NOT work properly in multithreaded servers like IIS
cgi.force_redirect 0 This must be set in order for IIS to work with PHP



  • [Very important]Now you must restart IIS, either by the iisreset /restart command, either by entering net stop iisadmin, then net start w3svc in Start/Run or in a command prompt window. Just stoping and starting the Default WebSite doesn't work


You should now have a functional PHP engine. To test, add a test.php file in c:\inetpub\wwwroot containing
<? echo phpinfo(); ?>
and open it with the browser at http://localhost/test.php. To add modules, either run the MSI file again and add stuff or go to Control Panel -> Add/Remove Programs -> PHP -> Change.

Errors:

  • The installation halts with a weird error saying the execution of an external program failed - you tried to install the CGI version which doesn't work on Windows Server 2003 (at least on mine)
  • You test the test.php file and a memory error appears - you didn't restart IIS properly. In panic, you could restart your computer, just to be sure :)